A flash memory apparatus is a non-volatile memory whose storage medium is a Flash unit, and has a characteristic that data does not disappear after a power outage. Therefore, the flash memory apparatus is widely used as an external or internal memory. A flash memory apparatus using a Flash unit as a storage medium may be a Solid State Device (SSD), which is also referred to as a Solid State Drive (SSD), or another memory.
One SSD generally includes multiple flash chips, and each flash chip includes several blocks, where each block further includes multiple pages. In some cases, a page that is damaged (also referred to as a damaged page) may occur in a block. When an SSD writes data into a block that includes a damaged page, if the block that includes a damaged page is insufficient to store the data, generally, a new block is found to store an overflow of the data. Therefore, in the SSD, there are a large number of blocks that have been written with some data but are not filled with data, which reduces space utilization of blocks, and causes a waste of storage space of the SSD.